ShowTable of Contents
dojo.style accepts 3 different parameters depending on what you want to do:
* The ID of the NODE, you can use dojo.byId or just hard-code it or use a variable
* The style parameter you want to get or change (i.e. position, margin, padding, etc.). This can also be an array of elements
* What you want to set the style parameter to
Get the style of a DOM Node
Say you want to get the current style of a DOM Node. You would simply do something like this:
This would return what the value of "margin-top" is for the ID-Of-DOM-NODE element on the page.
Set the style of a DOM Node
So now you want to set the style of a DOM Node on the page. You would do this:
You can also set many style elements by passing in an array:
This comes in really handy when adjusting the position of elements on the page or when you need to change the style of an element when something happens. Using just a CSS file you can't do this. I think this is a great asset and not to mention it's very easy to do. Start combining this with dojo.coords, dojo.query and getClientId and you've got yourself a very powerful way of manipulating the style of DOM Nodes within an XPage or even pre-XPage web pages if you're willing to go the distance to include dojo support.
for other Lotus Notes/Domino/XPage articles